<div class="container-fluid" style="padding: 20px 10px 0px 10px">
	<div class="row-fluid">
		<div class="well">
		    <ul class="nav nav-tabs">
		      <li class="active"><b>员工管理</b></li>
		    </ul>
		    <div id="myTabContent" class="tab-content">
				<div class="tab-pane active in" id="home">
					<form id="formid" action="/auth/doauth" method="post">
						<p>员工名称：<input type="text" name="fuser_name" placeholder="员工名称" value="<?=str_replace(session('loginName'),'',$sData['fuser_name'])?>"  style="width:190px" /> 登录名：<span id="loginName">-</span></p>
						<p>登陆密码：<input type="password" name="password" placeholder="<?=$sData['fuser_id'] ? '为空则不修改' : '登陆密码'?>" value="" style="width:346px" /></p>
						<p>员工角色：<select name="fauth_id" style="width:142px"><?php $getAuths = explode(',',getSysConfig('pdlCheck'));?>
							<?php foreach($getAuths AS $valfs){$detail = explode('_',$valfs);?>
								<option <?=$detail[0] == $sData['fauth_id'] ? 'selected="selected"' : ''?> value="<?=$detail[0]?>"><?=$detail[1]?></option>
							<?php }?></select>&nbsp;简述：<input type="text" value="" name="fauth_name" id="fName" style="width:156px" />
						</p>
						<input type="hidden" value="1" name="dosubmit" />
						<input type="hidden" value="<?=$sData['fuser_id']?>" name="fuser_id" />
					</form>
				</div>
				<div class="btn-toolbar">
				    <button class="btn btn-primary" id="btn-save" style="margin-left:87px;margin-top:11px"><i class="icon-save"></i> 保存</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
$(function(){
	$('#btn-save').click(function(){
		if($('input[name="fuser_name"]').val() == ''){
			showmsg('员工名称不能为空');return false;
		}else if($('input[name="fauth_name"]').val() == ''){
			showmsg('员工简述不能为空');return false;
		}else{
			<?php if(!$sData['fuser_id']){?>
			if($('input[name="password"]').val() == ''){
				showmsg('登陆密码不能为空');return false;
			}
		<?php }?>
			setBtn($('#btn-save'));
			$('#formid').submit();
		}
	});
	$('select[name="fauth_id"]').change(function(){
		if($(this).val() == '3'){
			$('#fName').val('');$('#fName').attr('placeholder','简述该常规质检/必填');
			$('#fName').attr('disabled',false);
			<?php if($sData['fauth_name']){?>
				$('#fName').val("<?=$sData['fauth_name']?>");
			<?php }?>
		}else{
			$('#fName').val($('select[name=fauth_id]').find('option:selected').text());
			$('#fName').attr('disabled',true);
		}
	}).trigger('change');
	setInterval(function(){
		if($('input[name="fuser_name"]').val()){
			$('#loginName').html('<?=session("loginName")?>'+$('input[name="fuser_name"]').val());
		}},100);
})
</script>